﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ModulesPage.Master" AutoEventWireup="true" CodeBehind="UserManagement.aspx.cs" Inherits="SwenAssignment3.UserCreationModule.UserManagement" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1
        {
            text-decoration: underline;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <p>
        <span class="auto-style1"><strong>User Managment</strong></span><br />
    </p>
    <p>
        
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="StaffID" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="StaffID" HeaderText="StaffID" ReadOnly="True" SortExpression="StaffID" />
                <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
                <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
                <asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
                <asp:BoundField DataField="HomeAddress" HeaderText="HomeAddress" SortExpression="HomeAddress" />
                <asp:BoundField DataField="PhoneNo" HeaderText="PhoneNo" SortExpression="PhoneNo" />
                <asp:BoundField DataField="BankAccNo" HeaderText="BankAccNo" SortExpression="BankAccNo" />
                <asp:BoundField DataField="DutiesID" HeaderText="DutiesID" SortExpression="DutiesID" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <SortedAscendingCellStyle BackColor="#FDF5AC" />
            <SortedAscendingHeaderStyle BackColor="#4D0000" />
            <SortedDescendingCellStyle BackColor="#FCF6C0" />
            <SortedDescendingHeaderStyle BackColor="#820000" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=USER-MSI\MSSQLSERVER2012;Initial Catalog=DRHotelDB;User ID=sa;Password=imsa" DeleteCommand="DELETE FROM [StaffProfile] WHERE [StaffID] = @StaffID" InsertCommand="INSERT INTO [StaffProfile] ([StaffID], [FirstName], [LastName], [DOB], [HomeAddress], [PhoneNo], [BankAccNo], [DutiesID]) VALUES (@StaffID, @FirstName, @LastName, @DOB, @HomeAddress, @PhoneNo, @BankAccNo, @DutiesID)" ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [StaffProfile]" UpdateCommand="UPDATE [StaffProfile] SET [FirstName] = @FirstName, [LastName] = @LastName, [DOB] = @DOB, [HomeAddress] = @HomeAddress, [PhoneNo] = @PhoneNo, [BankAccNo] = @BankAccNo, [DutiesID] = @DutiesID WHERE [StaffID] = @StaffID">
            <DeleteParameters>
                <asp:Parameter Name="StaffID" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="StaffID" Type="String" />
                <asp:Parameter Name="FirstName" Type="String" />
                <asp:Parameter Name="LastName" Type="String" />
                <asp:Parameter DbType="Date" Name="DOB" />
                <asp:Parameter Name="HomeAddress" Type="String" />
                <asp:Parameter Name="PhoneNo" Type="Int32" />
                <asp:Parameter Name="BankAccNo" Type="String" />
                <asp:Parameter Name="DutiesID" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="FirstName" Type="String" />
                <asp:Parameter Name="LastName" Type="String" />
                <asp:Parameter DbType="Date" Name="DOB" />
                <asp:Parameter Name="HomeAddress" Type="String" />
                <asp:Parameter Name="PhoneNo" Type="Int32" />
                <asp:Parameter Name="BankAccNo" Type="String" />
                <asp:Parameter Name="DutiesID" Type="String" />
                <asp:Parameter Name="StaffID" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
        
    </p>
        </asp:Content>
